<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>用户注册</title>
<link type="text/css" rel="stylesheet" href="css/style.css">

<script type="text/javascript" src="./js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="./js/jquery.validate.min.js"></script>
</head>

<body class="back">

<div class="reg">
	<h3>用户注册</h3>
    
    <form id="register">
    	<ul class="zc_form">
    		<li><input type="text" class="reg_txt" value="" id="regTel" name="regTel" placeholder="请输入手机号"></li>
    		<li><input type="text" class="reg_txt" value="" id="regPass" name="regPass" placeholder="请输入密码"></li>
    		<li><input type="text" class="reg_txt" value="" id="regPassOk" name="regPassOk" placeholder="请确认密码"></li>
    		<li><input type="submit" class="reg_sub" value="注册" name=""></li>
    		<li><a href="#" class="reg_see">返回</a></li>
    	</ul>
    </form>
</div>
<script type="text/javascript">
$(function(){
	var validator = $("#register").validate({
			rules: {
				regTel: {
					required: true,
					maxlength: 11,
					isMobile: true
				},
				regPass: {
					required: true,
					minlength: 6
				},
				regPassOk: {
					required: true,
					minlength: 6,
                    equalTo: "#regPass"
				}
			},
			messages: {
				regTel: {
					required: "请输入手机号",
					maxlength: "请输入正确手机号",
					isMobile: "请输入正确手机号"
				},
				regPass: {
					required: "请输入密码",
					minlength: '不能小于六位'
				},
				regPassOk: {
					required: "两次密码不一致",
					minlength: '不能小于六位',
                    equalTo: "两次密码不一致"

				}
			},
			submitHandler: function(form) {
				alert('通了')
			}
		});
})
</script>
</body>


</html>
